home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / 131_01.zip / TEST1.CSM < prev    next >
Text File  |  1993-06-05  |  2KB  |  86 lines

  1. ;CRL Assembler Test File
  2. ;
  3. ;Pseudo ops and expression evaluation
  4.  
  5.                 ;equ test
  6. zero    equ    0        ;define a symbol
  7. null    equ    zero        ;referance it
  8.  
  9.                 ;set test
  10. foo    set    1        ;redefinable symbol
  11. foo    set    2        ;redefine it
  12.  
  13.                 ;Test Number conversion
  14. b2    equ    10b        ;binary
  15. b8    equ    10q        ;octal
  16. b9    equ    10o        ;  "
  17. b10    equ    10        ;decimal
  18. b11    equ    10d        ;  "
  19. b16    equ    10h        ;hex
  20.  
  21.                 ;Test Expression Evaluation
  22. u1    equ    -4        ;unary -
  23. u2    equ    NOT 1        ;not
  24. u3    equ    HIGH 1234h    ;high
  25. u4    equ    LOW 1234h    ;low
  26.  
  27. x1    equ    2+2        ;addition
  28. x2    equ    3-2        ;subtraction
  29. x3    equ    2*3        ;multiplication
  30. x4    equ    8/2        ;division
  31. x5    equ    10 MOD 4    ;mod
  32. x6    equ    1 SHL 3        ;shift left
  33. x7    equ    80h SHR 4    ;shift right
  34. x8    equ    0FFh AND 5    ;and
  35. x9    equ    1 OR 2        ;or
  36. x10    equ    5 XOR 4        ;xor
  37.  
  38. p1    equ    2*(1+3)        ;parentheses
  39.  
  40.  
  41. ;Function Definition
  42.  
  43. func1    FUNCTION extrn1, extrn2
  44.  
  45. loc1    equ    zero        ;local symbol definition
  46.                 ;referancing a global symbol
  47. loc2    set    0        ;local set absolute
  48. loc2    set    $        ;redefined relocatable
  49.  
  50. foo    set    3        ;redefine global set
  51.  
  52.                 ;db test
  53.     db    1,2,3+4        ;bytes
  54.     db    'string',0    ;mixed
  55.     db    'A'+20h        ;char expression
  56.  
  57.                 ;dw test (and $)
  58.     dw    2+4        ;absolute expression
  59.     dw    $        ;relocatable expression
  60.     dw    extrn1        ;external function referance
  61.     dw    1,2,3        ;multiple values
  62.  
  63.     ds    5        ;ds test
  64.  
  65. label:    dw    label        ;label definition
  66.  
  67.                 ;Mixed type expressions
  68.     dw    $+1        ;rel + abs
  69.     dw    $-1        ;rel - abs
  70.     dw    1+$        ;abs + rel
  71.     dw    $-$        ;rel - rel
  72.  
  73.     FEND
  74.  
  75.  
  76. ;Test for unique locals
  77.  
  78. func2    FUNCTION
  79.  
  80. loc1    equ    1        ;unique from prev function
  81.     dw    foo        ;'set' value redefined in func1
  82.  
  83.     FEND
  84.  
  85.     end
  86.